#ifndef _H_BASEBOARD
#define _H_BASEBOARD

#include <string>
#include <iostream>
#include <vector>

class baseToken;
class baseCard;

class baseBoard
{
    private:
        int width;
        int height;
        std::vector<std::vector<baseCard*>> cardsMatrix;
        std::vector<std::vector<int>> costModificationMatrix;

    public:
        // Constructor
        baseBoard(int size);
        baseBoard(int width, int height);
        
        // Accessor
        int getWidth();
        int getHeight();
        std::vector<std::vector<baseCard*>> getCardsMatrix();

        // Print
        std::string toString();
        void toString(std::ostream &out);
        void toString(std::string &str);

        void display();
        void addCard(baseCard& aCard);
        void addCard(baseCard& aCard, int column, int row);
        void removeCard(baseCard& aCard);
        baseCard* getCard(int column, int row);
        void moveUpColumn(int aColumnNum);
        void moveDownColumn(int aColumnNum);
        void moveRightRow(int aRowNum);
        void moveLeftRow(int aRowNum);
        int countCards();
        bool isFull();

        int getCostModifier(baseCard& aCard);

    private:
        std::string cardsMatrixToString();
        void printGrid(char* buffer, int allocatedSize, int cardWidth, int cardHeight);
        void initCardsMatrix(int aWidth, int aHeight);
        void initCostModificationMatrix(int aWidth, int aHeight);
};

#endif //_H_BASEBOARD